<template>
  <div class='carts' >
      <van-swipe-cell  v-for="data in cart" :key="data.id">
<van-card
  :price="data.price"
  :title="data.name"
 :thumb="data. picture"
>
  <template #num>
   <p>{{data. checked? '已完成':''}}</p>
  </template>
</van-card>
 <template #right>
          <van-button
            square
            text="再来一单"
            type="danger"
            class="delete-button"
            @click="$router.back()"
               />
        </template>
      </van-swipe-cell>
  </div>
</template>

<script>
import { mapState, mapMutations, mapGetters } from 'vuex'
export default {
  name: 'cart',
  data () {
    return {
      value: 1,
    }
  },
  created () {
    console.log(this.cart, 'sd')
  },
  computed: {
    ...mapState({
      cart: state => state.cartList.cart,
    }),
    ...mapGetters(['totalMoney', 'totalAmount']),
  },
  methods: {
    ...mapMutations(['remove']),
    onChange () {

    },
    onSubmit () {

    },
  },
}
</script>

<style lang='less' scoped>
 .van-submit-bar{

  position: fixed;
  bottom: 0px;
  z-index: 9999;
}
 .custom-image .van-empty__image {
    width: 180px;
    height: 180px;
  }
  .empty-link {
    color: #f00;
  }
  .delete-button {
    height: 100%;
  }
  .van-card__thumb {
    display: flex;
    width: 220px;
  }
</style>
